<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui"

      xmlns:f="http://java.sun.com/jsf/core">
    <ui:composition template="layout.xhtml">
        <ui:define name="body">
            <h2>Editar Cartório</h2>
            <h:form id="form" acceptcharset="utf-8">
                <p:growl id="msg" life="3000"/>
                <p:panel styleClass="container_24 clearfix " style="background: none; border: none;">
                    <p class="subtitle">Dados do Cartório</p>

                    <p:outputLabel value="Nome :" styleClass="grid_3"/>
                    <p:inputText value="#{managerEditNotaryOffice.notaryOffice.nome}" styleClass="grid_18"/>
                    <p:outputLabel value="Denominação :" styleClass="grid_3"/>
                    <p:inputText value="#{managerEditNotaryOffice.notaryOffice.denominationOffice}" styleClass="grid_18"/>
                    <p:outputLabel value="Natureza :" styleClass="grid_3"/>
                    <p:inputText value="#{managerEditNotaryOffice.notaryOffice.natureOffice}" styleClass="grid_18"/>
                    <p:outputLabel value="Email :" styleClass="grid_3"/>
                    <p:inputText value="#{managerEditNotaryOffice.notaryOffice.email}" styleClass="grid_18"/>
                    <div class="clear"/>

                    <p class="subtitle">Dados do Titular</p>
                    <p:outputLabel value="Titular :"  styleClass="grid_3"/>
                    <p:inputText value="#{managerEditNotaryOffice.notaryOffice.titular}"  styleClass="grid_18"/>
                    <p:outputLabel value="Cpf:"  styleClass="grid_3"/>
                    <p:inputMask value="#{managerEditNotaryOffice.notaryOffice.cpf}" mask="999.999.999-99" styleClass="grid_18"/>
                    <h:outputLabel value="Ingresso:  "  styleClass="grid_3"/>
                    <div class="grid_18">
                        <p:selectOneMenu style="width: 145px"  id="type" value="#{managerEditNotaryOffice.notaryOffice.admission}" >
                            <f:selectItems var="item" itemLabel="#{item.toString()}" itemValue="#{item}"  value="#{managerEditNotaryOffice.admission}" />  
                        </p:selectOneMenu>
                    </div>
                    <div class="clear"/>
                    <h:outputLabel value="Data Posse:  "  styleClass="grid_3"/>
                    <p:calendar value="#{managerEditNotaryOffice.notaryOffice.datePossesion}" 
                                autocomplete="true" styleClass="grid_10" />

                    <div class="clear"/>

                    <p class="subtitle">Dados do Endereço</p>

                    <p:outputLabel value="Rua :"  styleClass="grid_3"/>
                    <p:inputText value="#{managerEditNotaryOffice.addres.street}" styleClass="grid_18"/>
                    <p:outputLabel value="Bairro :"  styleClass="grid_3"/>
                    <p:inputText value="#{managerEditNotaryOffice.addres.district}" styleClass="grid_18"/>
                    <p:outputLabel value="Num :"  styleClass="grid_3"/>
                    <p:inputText value="#{managerEditNotaryOffice.addres.num}"  styleClass="grid_18"/>
                    <p:outputLabel value="Cep :"  styleClass="grid_3"/>
                    <p:inputMask mask="99.999-999" value="#{managerEditNotaryOffice.addres.cep}"  styleClass="grid_18"/>

                    <p:outputLabel  value=" Cidade: "  styleClass="grid_3" />
                    <p:autoComplete id="cidadeEstado" value="#{managerEditNotaryOffice.addres.city}" completeMethod="#{managerCreateAddress.completeCity}"   
                                    var="city"  required="true" requiredMessage="o campo cidade deve ser preenchido"
                                    itemLabel="#{city.name} #{city.states.sgl}" itemValue="#{city}"
                                    converter="cityConverter" forceSelection="true" 
                                    converterMessage="Erro, verifique a cidade" minQueryLength="3"
                                    maxResults="10" dropdown="true"  styleClass="grid_9"> 
                    </p:autoComplete>
                    <div class="clear"/>
                    <p:outputLabel value="Telefone :"  styleClass="grid_3"/>
                    <p:inputMask mask="99-9999-9999" value="#{managerEditNotaryOffice.addres.phone}"  styleClass="grid_3"/>
                    <p:outputLabel value="Celular :"  styleClass="grid_3"/>
                    <p:inputMask mask="99-9999-9999"  value="#{managerEditNotaryOffice.addres.cellular}"  styleClass="grid_3"/>


                    <div class="clear"/>
                    <div class="buttonAction">
                        <p:commandButton value="Atualizar" icon="ui-icon-document"  styleClass="ui-priority-primary"
                                          actionListener="#{managerEditNotaryOffice.update()}" update="@form, msg"/>
                        <p:commandButton value="Cancelar" icon="ui-icon-close"   
                                         actionListener="#{managerRedirect.redirect('viewNotaryOffice.xhtml')}" immediate="true"/>
                    </div>
                </p:panel> 
            </h:form>
        </ui:define>
    </ui:composition>
</html>


